home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / raytrace / pov / gen / prepov05 / example.pre < prev    next >
Text File  |  1993-02-11  |  2KB  |  99 lines

  1. // Example of preprocesor using PREPOV05
  2. // usage >  PREPOV05 EXAMPLE.PRE EXAMPLE.POV
  3.  
  4. /*
  5.   In this example I want to put a ball in the x-z plane using polar notation
  6.  
  7. z                              You can define a position in the plane with
  8.   ^    /                       a vector with length p, and angle value Alfa.
  9.   |   /p
  10.   |  /                         In cartesian coords   x = p*cos(Alfa)
  11.   | /                                                z = p*sin(Alfa)
  12.   |/ ) Alfa
  13.   +---------------->
  14.                    x
  15.  
  16. */
  17.  
  18. #include "colors.inc"
  19. #include "shapes.inc"
  20. #include "textures.inc"
  21.  
  22.  
  23. #d1 = 4
  24. #d2 = 2      
  25. // 4 total positions with 2 fractional (X.XX)
  26.  
  27. #00 = 1      
  28. // Camera Zoom value
  29.  
  30. #01 = 0.785   
  31. // Alfa=45 =~ Pi/4
  32.  
  33. #02 = 10     
  34. // p length
  35.  
  36. #03 = 5      
  37. // ball radius
  38.  
  39. camera
  40. {
  41.        location <0 10 -30>
  42.        direction <0 0 @00>     // @00 = Camera Zoom Value
  43.        up  <0 1 0>
  44.        right <1.333 0 0>
  45.        look_at <0 10 10>
  46. }
  47.  
  48. #declare ball = object
  49.                       {
  50.                        sphere{ <0 0 0> @03}    // @03 = ball radius
  51.                       }
  52.  
  53. #declare oro = texture
  54.                           {
  55.                            Gold_Texture
  56.                            ambient 0.4
  57.                            diffuse 0.6
  58.                            reflection 0.40
  59.                           }
  60.  
  61. #declare floor = texture
  62.                       {
  63.                         checker
  64.                               color Red
  65.                               color Blue
  66.                         ambient 0.3
  67.                         diffuse 0.7
  68.                         reflection 0.6
  69.                         scale <5 5 5>
  70.                       }
  71.  
  72.  
  73.  
  74. // Light
  75. object
  76. {
  77.    light_source { <200 1500 -500> colour White }
  78. }
  79.  
  80. // --------------------------------- FLOOR
  81. object
  82. {
  83.  box{ <-20 -1 0> <20 0 40>}
  84.  texture{ floor }
  85. }
  86.  
  87.  
  88. #d1 = 8
  89. #d2 = 8
  90. // 8 digits floating point from here
  91.  
  92. // --------------------------------  BALL
  93. object
  94. {
  95.  ball
  96.  translate <[@02*cos(@01)] [@03] [@02*sin(@01)]>
  97.  texture {oro}
  98. }
  99.